(find-alternate-file): Bind kill-buffer-query-functions locally, don't set it.
authorRichard M. Stallman <rms@gnu.org>
Tue, 27 Aug 2002 20:37:00 +0000 (20:37 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 27 Aug 2002 20:37:00 +0000 (20:37 +0000)
lisp/files.el

index abba36a5c07fd155450af2edbe9e06e26c30d480..2d129c888e5bc5bd4c59cc948b2ebd3d9a5dc8eb 100644 (file)
@@ -964,9 +964,10 @@ If the current buffer now contains an empty file that you just visited
        (lock-buffer)
        (rename-buffer oname)))
     (unless (eq (current-buffer) obuf)
-      ;; We already asked; don't ask again.
-      (setq kill-buffer-query-functions nil)
-      (kill-buffer obuf))))
+      (with-current-buffer obuf
+       ;; We already asked; don't ask again.
+       (let ((kill-buffer-query-functions))
+         (kill-buffer obuf))))))
 \f
 (defun create-file-buffer (filename)
   "Create a suitably named buffer for visiting FILENAME, and return it.